import Content from '@/sheep/layouts/content.vue';
import { request } from '@/sheep/request';
import { SELECT, RECYCLE_BIN, CRUD, RECYCLE } from '@/sheep/request/crud';

const route = {
  path: 'task',
  name: 'shop.admin.task',
  component: Content,
  meta: {
    title: '商品管理',
  },
  children: [
    {
      path: 'goods',
      name: 'shop.admin.task.goods',
      component: () => import('./goods/index.vue'),
      meta: {
        title: '商品任务',
      },
    },
    {
      path: 'real',
      name: 'shop.admin.task.real',
      component: () => import('./real/index.vue'),
      meta: {
        title: '实探任务',
      },
    },
    {
      path: 'material',
      name: 'shop.admin.task.material',
      component: () => import('./material/index.vue'),
      meta: {
        title: '自剪素材',
      },
    },
    
   
   
   
  ],
};

const api = {
  goods:{
    ...CRUD('daren/admin/job', ['list', 'detail', 'add','delete']),
    // 上下架
    upStatus: (data) =>
      request({
        url: 'daren/admin/job/shelfStatusEdit',
        method: 'POST',
        data,
      }),
  },
  real:{
    ...CRUD('daren/admin/probe_job', ['list', 'detail', 'add','delete']),
    // 上下架
    upStatus: (data) =>
      request({
        url: 'daren/admin/probe_job/shelfStatusEdit',
        method: 'POST',
        data,
      }),
  },
  raise:{
   
    
    list: (params) =>
      request({
        url: `shop/admin/crowd/list`,
        method: 'GET',
        params,
      }),
    
    
    detail: (id) =>
      request({
        url: `shop/admin/crowd/details/`+id,
        method: 'GET',
      }),
    
    
    upStatus: (data) =>
      request({
        url: 'shop/admin/crowd/upStatus',
        method: 'POST',
        data,
      }),
  },
  business:{
    list: (params) =>
      request({
        url: '/operations/admin/shop',
        method: 'GET',
        params
      }),
    add_account:(data)=>
      request({
        url: `/operations/admin/shop`,
        method: 'POST',
        data
      }),
    edit_account:(id,data)=>
      request({
        url: `/operations/admin/shop/${id}`,
        method: 'PUT',
        data
      }),
    account_info: (id) =>
      request({
        url: `/operations/admin/shop/${id}`,
        method: 'GET',
      }),
    store_info: (id) =>
      request({
        url: `/operations/admin/store/${id}`,
        method: 'GET',
      }),
    store_edit: (id, data) =>
      request({
        url: `/operations/admin/store/${id}`,
        method: 'PUT',
        data,
      }),
    industry_list: (params) =>
      request({
        url: '/operations/admin/category',
        method: 'GET',
        params,
      }),
    add_aptitude: (data) =>
      request({
        url: '/operations/admin/category',
        method: 'POST',
        data,
      }),
    reapply_aptitude: (id, data) =>
      request({
        url: `/operations/admin/category/${id}`,
        method: 'PUT',
        data,
      }),
    brand_list:(params)=>
      request({
        url: '/operations/admin/brand',
        method: 'GET',
        params
      }),
  },
  order: {
    ...CRUD('shop/admin/order/order', ['list', 'detail', 'edit']),
  },
  group: {
    ...CRUD('file/admin/group'),
  },
 
};

export { route, api };
